<template>
	<view style="height: 720rpx;display: flex;justify-content: center;align-items: center;">
		<view>
			<text>自动登录中..</text>
		</view>
	</view>
</template>
<script>
import { doPost } from '../../config/request'
import { setAuthorization } from '../../config/store'
	export default {
		onLoad() {
			this.wxLogin()
		},
		methods: {
			wxLogin() {
				uni.login({
					success: (res) => {
						doPost("/public/wx_miniapp_login",{code:res.code},function({data}){
							setAuthorization(data.token)
							uni.switchTab({
								url: "/pages/index/index"
							})
						})
					}
				})
			}
		}
	}
</script>
<style>
</style>